<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <!-- 标准的理想视口 -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable=no">
  <title>首页</title>
  <!-- 1 引入 4个 样式文件 -->
  <link rel="stylesheet" href="./lib/mui/css/mui.css">
  <link rel="stylesheet" href="./lib/fontawesome/css/font-awesome.css">
  <link rel="stylesheet" href="./css/common.css">
  <link rel="stylesheet" href="./css/index.css">
</head>

<body>
  <!-- 主要用在显示网页内容 -->
  <div class="pyg_view">
    <header class="pyg_header">
      <div class="mui-input-row mui-search">
        <input type="search" class="mui-input-clear" placeholder="">
      </div>
    </header>

    <!-- 主要内容 -->
    <div class="pyg_main">
      <!-- 轮播图 -->
      <div class="pyg_slides"></div>

      <!-- 分类菜单 -->
      <div class="pyg_cates">

      </div>

      <!-- 商品列表 -->
      <div class="pyg_list">
       
      </div>
    </div>

    <footer class="pyg_footer">
      <a href="javascript:;">
        <span class="fa fa-home"></span>
        <div>首页</div>
      </a>
      <a href="./pages/category.html">
        <span class="fa fa-list-ul"></span>
        <div>分类</div>
      </a>
      <a href="javascript:;">
        <span class="fa fa-shopping-cart"></span>
        <div>首页</div>
      </a>
      <a href="javascript:;">
        <span class="fa fa-user"></span>
        <div>首页</div>
      </a>
    </footer>
  </div>
</body>

<!-- 模板引擎 -->
<!-- 轮播图 -->
<script type="text/html" id="slideTpl">
  <div class="mui-slider">
        <!-- 轮播图片 -->
        <div class="mui-slider-group mui-slider-loop">
                    <!--支持循环，需要重复图片节点-->
            <div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img src="{{data[data.length-1].image_src}}" /></a></div>
                {{each data  value}}
                <div class="mui-slider-item"><a href="#"><img src="{{value.image_src}}" /></a></div>
                {{/each}}
          <!--支持循环，需要重复图片节点-->
          <div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img src="{{data[0].image_src}}" /></a></div>
        </div>
        <!-- 索引器 -->
        <div class="mui-slider-indicator">
            {{each data  value index}}
            {{if index == 0}}
            <div class="mui-indicator mui-active"></div>
            {{/if}}
            {{if index != 0}}
            <div class="mui-indicator"></div>
            {{/if}}
            {{/each}}
          </div>
      </div>

 </script>

<!-- 分类菜单 -->
<script type="text/html" id="cateTpl">
  {{each data value}}
  <a href="javascript:;">
      <img src="{{value.image_src}}" alt="">
    </a>
  {{/each}}
</script>

<!-- 商品列表 -->
<script type="text/html" id="listTpl" >
  {{each data value1}}
  <div class="goods_item">
    <div class="goods_title"><img src="{{value1.group_img}}" alt=""></div>
    <ul>

      {{each value1.goods value2}}
      <li>
        <a class="goods_detail" href="./pages/goods_detail.html?goods_id={{value2.goods_id}}">
          <img src="{{value2.goods_small_logo}}"
            alt="">
          <div class="goods_name">
              {{value2.goods_name}}
          </div>
          <div class="goods_price">￥{{value2.goods_price}}</div>
        </a>
        <a href="./pages/goods_list.html?cid={{value2.cat_id}}" class="mui-btn mui-btn-primary mui-btn-outlined goods_like">
          找相似
        </a>
      </li>
  {{/each}}

    </ul>
  </div>
  {{/each}}
</script>
<!-- 模板引擎 -->


<!-- 2 引入js文件 -->
<script src="./lib/mui/js/mui.js"></script>
<script src="./lib/zepto/zepto.js"></script>
<script src="./lib/arttemplate/template-web.js"></script>
<script src="./js/common.js"></script>
<script src="./js/index.js"></script>

</html>